﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<int>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Upload images
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Upload images for the site</h2>

    <form id="file_upload" action="/SisocanaBackEnd/Site/PUploadImages/<%= Model %>" method="post" enctype="multipart/form-data">
        <%= Html.Hidden("id", Model) %>
        <input type="file" name="file[]" multiple="multiple" />
        <button>Upload</button>
        <div class="file_upload_label">Select the images</div>
    </form>

    <table id="files"></table>
    <table class="download_files">
    <% foreach (System.IO.FileInfo file in (System.IO.FileInfo[])ViewData["FileEntryCollection"]) { %>
            <tr>
                <td class="file_preview"></td>
                <td class="filename"><a><%=file.Name%></a></td>
                <td class="filesize"><%=file.Length / 1024 %> KB</td>
                <td id="file_delete_<%= file.Name %>" class="file_delete">
                    <button id="deleteButton_<%= file.Name %>" title="Delete" onclick="javascript:deleteFile(<%= Model %>, '<%= file.Name %>'); return false;" class="ui-state-default ui-corner-all ui-state-hover">
                        <span class="ui-icon ui-icon-trash"></span>
                    </button>
                </td>
            </tr>
    <% } %>
    </table>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/base/jquery-ui.css" id="Link1">
    <link rel="stylesheet" href="<%: Url.Content("~/Content/jquery.fileupload-ui.css") %>">
    
    <script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>   
    <script src="<%: Url.Content("~/Scripts/jquery.fileupload-ui.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.fileupload.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/imageuploader.js") %>" type="text/javascript"></script>
</asp:Content>
